class Solution {
public:
    int maxIncreasingSubarrays(vector<int>& nums) {
        int n = nums.size();
        vector<int> table(n, 1);

        for (int i = 1; i < n; i++) {
            if (nums[i] > nums[i - 1]) table[i] += table[i - 1];
        }

        int k = 1;
        for (int i = 1; i < n; i++) {
            if (i - table[i] == -1) k = max(k, table[i] / 2);
            else k = max(k, max(table[i] / 2, min(table[i], table[i - table[i]])));
        }
        return k;
    }
};